// Decompiled by GOOSIN CO,LTD Copyright 2010 Pavel Kouznetsov.
// home page: http://www.Goosin.net
// Decompiler options: packimports(3) fieldsfirst ansi space 
// Source File Name:   AutoExecute.java

package include.auto_execute;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.TimerTask;

// Referenced classes of package include.auto_execute:
//			ConfigReader

public class AutoExecute extends TimerTask
{

	private ConfigReader reader;

	public AutoExecute()
	{
		reader = null;
		reader = new ConfigReader();
	}

	public void run()
	{
		String classNames[] = reader.getClassNames();
		for (int i = 0; i < classNames.length; i++)
			try
			{
				Class mclass = Class.forName(classNames[i]);
				Object obj = mclass.newInstance();
				String methodName = reader.getMethod(classNames[i]);
				Method method = mclass.getMethod(methodName, new Class[0]);
				method.invoke(obj, null);
			}
			catch (ClassNotFoundException cnfe)
			{
				cnfe.printStackTrace();
			}
			catch (InstantiationException ie)
			{
				ie.printStackTrace();
			}
			catch (NoSuchMethodException nsme)
			{
				nsme.printStackTrace();
			}
			catch (IllegalAccessException ile)
			{
				ile.printStackTrace();
			}
			catch (InvocationTargetException ive)
			{
				ive.printStackTrace();
			}

	}

	public static void main(String args[])
	{
		(new AutoExecute()).run();
	}
}
